﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ChangePassword : System.Web.UI.Page
{
    AccountManager am = new AccountManager();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Username"] == null)
        {
            Response.Redirect("Default.aspx");
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string uname = Session["Username"].ToString();
        string pass1 = txtPassword.Text;
        string pass2 = txtConPass.Text;
        int changePassword = am.changePassword(uname, pass1);
        if (changePassword > 0)
        {
            Response.Redirect("Success.aspx");
        }
    }
}